# -*- coding: utf-8 -*-
# 姓名:谚语
# 开发时间:2022/10/30 11:39
from flask import Blueprint
from flask_restful import Api
from comment.utils.output import output_json

# 初始化消息模块的蓝图
# 构造函数: Blueprint(名字, __name__, 前缀)
account_bp = Blueprint('account', __name__, url_prefix='/account')
account_api = Api(account_bp)  # 创建资源对象(创建蓝图中的资源API)

# 在当前用户模块添加请求狗子
# user_bp.before_request()

# 使用我们自定义json格式，代替装饰器的写法
account_api.representation('application/json')(output_json)

# 加载当前模块的资源类
from financial.resources.account.account_resource import AccountInfo, AccountExtract, AccountRecharge

account_api.add_resource(AccountInfo, '/funds', endpoint='funds')  # 查询用户资金账户
account_api.add_resource(AccountExtract, '/extract', endpoint='extract')  # 提现
account_api.add_resource(AccountRecharge, '/recharge', endpoint='recharge')  # 充值
